﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ClusHal
{
    static class DataHelper
    {

        public static Action MinAction(List<Action> data)
        {
            Action min = null;
            if (data.Count > 0)
            {
                min = new Action(data[0]);
                for (int i = 1; i < data.Count; i++)
                {
                    Action b = data[i];
                    for (int j = 0; j < b.Size; j++)
                    {
                        if (min[j] > b[j])
                            min[j] = b[j];
                    }
                }
            }
            return min;
        }

        public static Action MaxAction(List<Action> data)
        {
            Action max = null;
            if (data.Count > 0)
            {
                max = new Action(data[0]);
                for (int i = 1; i < data.Count; i++)
                {
                    Action b = data[i];
                    for (int j = 0; j < b.Size; j++)
                    {
                        if (max[j] < b[j])
                            max[j] = b[j];
                    }
                }
            }
            return max;
        }
    }
}
